<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>cocos.actions.grid3d_actions.Waves</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body>
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar">
  <tr valign="middle">
  <!-- Project homepage -->
      <!--<th class="navbar" 
            ><a class="navbar" target="_top" href="http://www.cocos2d.org/">cocos2d API reference</a></th>-->

  <!-- Tree link -->
      <th><a
        href="module-tree.html">Trees</a></th>

  <!-- Index link -->
      <th><a
        href="identifier-index.html">Indices</a></th>

  <!-- Breadcrumbs -->
      <th class="navbar-breadcrumbs">
        <span class="breadcrumbs">
          <a href="cocos-module.html">cocos</a>&nbsp;.&nbsp;<a href="cocos.actions-module.html">actions</a>&nbsp;.&nbsp;<a href="cocos.actions.grid3d_actions-module.html">grid3d_actions</a>&nbsp;.&nbsp;Waves
        </span>
      </th>

      <th class="navbar last">
        <a href="javascript:toggleFrames()">Toggle&nbsp;frames</a>
      </th>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class cocos.actions.grid3d_actions.Waves</h1>
<pre class="base-tree">
    <a href="cocos.actions.base_actions.Action-class.html">base_actions.Action</a> --+            
                          |            
<a href="cocos.actions.base_actions.IntervalAction-class.html">base_actions.IntervalAction</a> --+        
                              |        
<a href="cocos.actions.basegrid_actions.GridBaseAction-class.html">basegrid_actions.GridBaseAction</a> --+    
                                  |    
      <a href="cocos.actions.basegrid_actions.Grid3DAction-class.html">basegrid_actions.Grid3DAction</a> --+
                                      |
                                     <strong class="uidshort">Waves</strong>
</pre>

<p>Simulates waves using the math.sin() function both in the vertical and horizontal axis.
The z coordinate is not modified.</p>
<p>Example:</p>
<pre class="py-doctest">
scene.do( Waves( waves=4, amplitude=20, hsin=False, vsin=True, grid=(16,16), duration=10) )</pre>

<!-- ==================== METHODS ==================== -->
<a name="section-Methods"></a>
        <h2>Methods</h2>
<table class="summary">
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a href="cocos.actions.grid3d_actions.Waves-class.html#init" class="summary-sig-name">init</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">waves</span>=<span class="summary-sig-default">4</span>,
        <span class="summary-sig-arg">amplitude</span>=<span class="summary-sig-default">20</span>,
        <span class="summary-sig-arg">hsin</span>=<span class="summary-sig-default">True</span>,
        <span class="summary-sig-arg">vsin</span>=<span class="summary-sig-default">True</span>,
        <span class="summary-sig-arg">*args</span>,
        <span class="summary-sig-arg">**kw</span>)</span>
<div class="summary-description">Initializes the Waves actions</div>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a href="cocos.actions.grid3d_actions.Waves-class.html#update" class="summary-sig-name">update</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">t</span>)</span>
<div class="summary-description">Gets called on every frame
't' is the time elapsed normalized to [0, 1]
If this action takes 5 seconds to execute, <code class="link">t</code> will be equal to 0
at 0 seconds.</div>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a name="__add__"></a><span class="summary-sig-name">__add__</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">action</span>)</span>
<div class="summary-description">sequence operator - concatenates actions
action1 + action2 -&gt; action_result
where action_result performs as:
first do all that action1 would do; then
perform all that action2 would do</div>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.base_actions.Action-class.html">cocos.actions.base_actions.Action</a>)</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a name="__init__"></a><span class="summary-sig-name">__init__</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">*args</span>,
        <span class="summary-sig-arg">**kwargs</span>)</span>
<div class="summary-description">dont override - use init</div>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.base_actions.Action-class.html">cocos.actions.base_actions.Action</a>)</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a href="cocos.actions.base_actions.IntervalAction-class.html#__mul__" class="summary-sig-name">__mul__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">other</span>)</span>
<div class="summary-description">repeats ntimes the action
action * n -&gt; action_result
where action result performs as:
repeat n times the changes that action would do</div>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.base_actions.IntervalAction-class.html">cocos.actions.base_actions.IntervalAction</a>)</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a name="__or__"></a><span class="summary-sig-name">__or__</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">action</span>)</span>
<div class="summary-description">spawn operator -  runs two actions in parallel
action1 | action2 -&gt; action_result</div>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.base_actions.Action-class.html">cocos.actions.base_actions.Action</a>)</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a href="cocos.actions.basegrid_actions.GridBaseAction-class.html#__reversed__" class="summary-sig-name">__reversed__</a>(<span class="summary-sig-arg">self</span>)</span>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.basegrid_actions.GridBaseAction-class.html">cocos.actions.basegrid_actions.GridBaseAction</a>)</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a href="cocos.actions.base_actions.IntervalAction-class.html#done" class="summary-sig-name">done</a>(<span class="summary-sig-arg">self</span>)</span>
<div class="summary-description">When in the worker role, this method is reliable.</div>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.base_actions.IntervalAction-class.html">cocos.actions.base_actions.IntervalAction</a>)</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a name="get_grid"></a><span class="summary-sig-name">get_grid</span>(<span class="summary-sig-arg">self</span>)</span>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.basegrid_actions.Grid3DAction-class.html">cocos.actions.basegrid_actions.Grid3DAction</a>)</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">(float, float, float)</span>
    </td><td class="summary">
        <span class="summary-sig"><a href="cocos.actions.basegrid_actions.Grid3DAction-class.html#get_original_vertex" class="summary-sig-name">get_original_vertex</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">x</span>,
        <span class="summary-sig-arg">y</span>)</span>
<div class="summary-description">Get the original vertex coordinate.</div>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.basegrid_actions.Grid3DAction-class.html">cocos.actions.basegrid_actions.Grid3DAction</a>)</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">(float, float, float)</span>
    </td><td class="summary">
        <span class="summary-sig"><a href="cocos.actions.basegrid_actions.Grid3DAction-class.html#get_vertex" class="summary-sig-name">get_vertex</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">x</span>,
        <span class="summary-sig-arg">y</span>)</span>
<div class="summary-description">Get the current vertex coordinate</div>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.basegrid_actions.Grid3DAction-class.html">cocos.actions.basegrid_actions.Grid3DAction</a>)</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a href="cocos.actions.basegrid_actions.Grid3DAction-class.html#set_vertex" class="summary-sig-name">set_vertex</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">x</span>,
        <span class="summary-sig-arg">y</span>,
        <span class="summary-sig-arg">v</span>)</span>
<div class="summary-description">Set a vertex point is a certain value</div>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.basegrid_actions.Grid3DAction-class.html">cocos.actions.basegrid_actions.Grid3DAction</a>)</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a href="cocos.actions.basegrid_actions.GridBaseAction-class.html#start" class="summary-sig-name">start</a>(<span class="summary-sig-arg">self</span>)</span>
<div class="summary-description">External code sets self.target and then calls this method.</div>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.basegrid_actions.GridBaseAction-class.html">cocos.actions.basegrid_actions.GridBaseAction</a>)</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a href="cocos.actions.base_actions.IntervalAction-class.html#step" class="summary-sig-name">step</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">dt</span>)</span>
<div class="summary-description">Dont customize this method: it will not be called when in the component
role for certain composite actions (like Sequence_IntervalAction).</div>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.base_actions.IntervalAction-class.html">cocos.actions.base_actions.IntervalAction</a>)</span>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <span class="summary-sig"><a name="stop"></a><span class="summary-sig-name">stop</span>(<span class="summary-sig-arg">self</span>)</span>
<div class="summary-description">When the action must cease to perform this function is called by
external code; after this call no other method should be called.</div>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.base_actions.Action-class.html">cocos.actions.base_actions.Action</a>)</span>
    </td>
  </tr>
</table>
<!-- ==================== INSTANCE VARIABLES ==================== -->
<a name="section-InstanceVariables"></a>
        <h2>Instance Variables</h2>
<table class="summary">
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="hsin"></a><span class="summary-name">hsin</span>
<div class="summary-description">whether or not it will do horizontal waves</div>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="vsin"></a><span class="summary-name">vsin</span>
<div class="summary-description">whether or not it will do vertical waves</div>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="waves"></a><span class="summary-name">waves</span>
<div class="summary-description">total number of wave</div>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="amplitude"></a><span class="summary-name">amplitude</span>
<div class="summary-description">amplitude of the waves</div>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a href="cocos.actions.grid3d_actions.Waves-class.html#amplitude_rate" class="summary-name">amplitude_rate</a>
<div class="summary-description">amplitude rate.</div>
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="target"></a><span class="summary-name">target</span>
<div class="summary-description"><a href="cocos.cocosnode.CocosNode-class.html" class="link">CocosNode</a> object that is the target of the action</div>
      <span class='inherited-from'>(Inherited from <a href="cocos.actions.base_actions.Action-class.html">cocos.actions.base_actions.Action</a>)</span>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
        <h2>Method Details</h2>
<table class="details">
</table>
<a name="init"></a>
<div class=" detail">
  <h3>init</h3>
  <div class="detail-signature">
    <span class="sig"><span class="sig-name">init</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">waves</span>=<span class="sig-default">4</span>,
        <span class="sig-arg">amplitude</span>=<span class="sig-default">20</span>,
        <span class="sig-arg">hsin</span>=<span class="sig-default">True</span>,
        <span class="sig-arg">vsin</span>=<span class="sig-default">True</span>,
        <span class="sig-arg">*args</span>,
        <span class="sig-arg">**kw</span>)</span>
    </div>
  <div class="detail-description">
  Initializes the Waves actions
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><dl class="parameters">
        <dt><span class="pname">waves</span> : <span class='ptype'>int</span></dt>
        <dd>Number of waves (2 * pi) that the action will perform. Default is 4</dd>
        <dt><span class="pname">amplitude</span> : <span class='ptype'>int</span></dt>
        <dd>Wave amplitude (height). Default is 20</dd>
        <dt><span class="pname">hsin</span> : <span class='ptype'>bool</span></dt>
        <dd>whether or not in will perform horizontal waves. Default is True</dd>
        <dt><span class="pname">vsin</span> : <span class='ptype'>bool</span></dt>
        <dd>whether or not in will perform vertical waves. Default is True</dd>
    </dl></dd>
    <dt>Overrides:</dt>
    <dd class="overrides">
      <a href="cocos.actions.basegrid_actions.GridBaseAction-class.html#init">basegrid_actions.GridBaseAction.init</a>
    </dd>
  </dl>
  </div>
</div>
<a name="update"></a>
<div class=" detail">
  <h3>update</h3>
  <div class="detail-signature">
    <span class="sig"><span class="sig-name">update</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">t</span>)</span>
    </div>
  <div class="detail-description">
  Gets called on every frame
't' is the time elapsed normalized to [0, 1]
If this action takes 5 seconds to execute, <code class="link">t</code> will be equal to 0
at 0 seconds. <code class="link">t</code> will be 0.5 at 2.5 seconds and <code class="link">t</code> will be 1 at 5sec.
This method must not use self._elapsed, which is not guaranted to be
updated.
  <dl class="fields">
    <dt>Overrides:</dt>
    <dd class="overrides">
      <a href="cocos.actions.base_actions.IntervalAction-class.html#update">base_actions.IntervalAction.update</a>
    </dd>
  </dl>
  </div>
</div>
<br />
<!-- ==================== INSTANCE VARIABLE DETAILS ==================== -->
<a name="section-InstanceVariableDetails"></a>
        <h2>Instance Variable Details</h2>
<table class="details">
</table>
<a name="amplitude_rate"></a>
<div class=" detail">
  <h3>amplitude_rate</h3>
  <div class="detail-description">
  amplitude rate. Default: 1.0
This value is modified by other actions like <a href="cocos.actions.basegrid_actions.AccelAmplitude-class.html" class="link">AccelAmplitude</a>.
  <dl class="fields">
  </div>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar">
  <tr valign="middle">
  <!-- Project homepage -->
      <!--<th class="navbar" 
            ><a class="navbar" target="_top" href="http://www.cocos2d.org/">cocos2d API reference</a></th>-->

  <!-- Tree link -->
      <th><a
        href="module-tree.html">Trees</a></th>

  <!-- Index link -->
      <th><a
        href="identifier-index.html">Indices</a></th>

  <!-- Breadcrumbs -->
      <th class="navbar-breadcrumbs">
        <span class="breadcrumbs">
          <a href="cocos-module.html">cocos</a>&nbsp;.&nbsp;<a href="cocos.actions-module.html">actions</a>&nbsp;.&nbsp;<a href="cocos.actions.grid3d_actions-module.html">grid3d_actions</a>&nbsp;.&nbsp;Waves
        </span>
      </th>

      <th class="navbar last">
        <a href="javascript:toggleFrames()">Toggle&nbsp;frames</a>
      </th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0beta1 on Wed Oct 26 10:00:12 2011
    </td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
